<html>
<body>
Reports call chain on a <code>Collection</code> that should be converted into <b>Sequence</b>.
<p>Each <code>Collection</code> transforming function (such as <code>map()</code> or <code>filter()</code>) creates a new
    <code>Collection</code> (typically <code>List</code> or <code>Set</code>) under the hood.
    In case of multiple consequent calls, and a huge number of items in <code>Collection</code>, memory traffic might be significant.
    In such a case, using <code>Sequence</code> is preferred.
</p>
<p><b>Example:</b></p>
<pre><code>
  class Entity(val key: String, val value: String)

  fun getValues(lines: List&lt;String&gt;) = lines
      .filter { it.isNotEmpty() }
      .map { it.split(',', limit = 2) }
      .filter { it.size == 2 }
      .map { Entity(it[0], it[1]) }
</code></pre>
<p>The quick-fix wraps call chain into <code>asSequence()</code> and <code>toList()</code>:</p>
<pre><code>
  class Entity(val key: String, val value: String)

  fun getValues(lines: List&lt;String&gt;) = lines
      .asSequence()
      .filter { it.isNotEmpty() }
      .map { it.split(',', limit = 2) }
      .filter { it.size == 2 }
      .map { Entity(it[0], it[1]) }
      .toList()
</code></pre>
<!-- tooltip end -->
</body>
</html>